package com.way;

import java.io.IOException;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Date;

/**
 * @author 魏彪
 */
public class DateServer {
    public static void main(String[] args) {
        try {
            ServerSocket socket = new ServerSocket(6013);

            while (true) {
                Socket client = socket.accept();
                PrintWriter printWriter = new PrintWriter(client.getOutputStream(), true);
                printWriter.println(new Date());
                client.close();
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
